﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using DAO;
using System.Data;

namespace BUS
{
    public class KhuyenMaiBUS
    {
        public static DataTable SelectKhuyenMaiAll(ref int tongKhuyenMai)
        {
            return KhuyenMaiDAO.SelectKhuyenMaiAll(ref tongKhuyenMai);
        }

        public static List<KhuyenMaiDTO> QueryAll()
        {
            return KhuyenMaiDAO.QueryAll();
        }

        public static DataTable SelectKhuyenMaiByAttribute(string maMonAn, int phanTramGiam, DateTime ngayBDTu, DateTime ngayBDDen, DateTime ngayKTTu, DateTime ngayKTDen, ref int tongKhuyenMai)
        {
            return KhuyenMaiDAO.SelectKhuyenMaiByAttribute(maMonAn, phanTramGiam, ngayBDTu, ngayBDDen, ngayKTTu, ngayKTDen, ref tongKhuyenMai);
        }

        public static DataTable SelectKhuyenMaiByMaMonAn(string maMonAn, ref int tongKhuyenMai)
        {
            return KhuyenMaiDAO.SelectKhuyenMaiByMaMonAn(maMonAn,ref tongKhuyenMai);
        }

        public static KhuyenMaiDTO SelectKhuyenMaiById(string maKhuyenMai)
        {
            return KhuyenMaiDAO.SelectKhuyenMaiById(maKhuyenMai);
        }

        public static bool InsertKhuyenMai(KhuyenMaiDTO khuyenMaiDTO)
        {
            return KhuyenMaiDAO.InsertKhuyenMai(khuyenMaiDTO);
        }

        public static bool UpdateKhuyenMaiById(KhuyenMaiDTO khuyenMaiDTO)
        {
            return KhuyenMaiDAO.UpdateKhuyenMaiById(khuyenMaiDTO);
        }

        public static bool DeleteKhuyenMaiById(string maKhuyenMai)
        {
            return KhuyenMaiDAO.DeleteKhuyenMaiById(maKhuyenMai);
        }

        public static string CreateKhuyenMaiId()
        {
            return KhuyenMaiDAO.CreateKhuyenMaiId();
        }
    }
}
